﻿using System;
using System.Runtime.InteropServices;

namespace AwesomeChromeFormUI.Native
{
    public class DwmApiNativeMethods
    {
        [StructLayout(LayoutKind.Sequential)]
        public struct MARGINS
        {
            public int Left;
            public int Right;
            public int Top;
            public int Bottom;

            public MARGINS(int left, int right, int top, int bottom)
            {
                Left = left;
                Right = right;
                Top = top;
                Bottom = bottom;
            }
        }
        /// <summary>
        /// 该函数的实现方式决定了阴影只能出现在窗口的右侧和底部
        /// </summary>
        /// <param name="hWnd"></param>
        /// <param name="pMarInset"></param>
        /// <returns></returns>
        [DllImport("dwmapi.dll")]
        public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);
    }
}
